var path = require('path')
var webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
	mode: 'development',
	entry: {

		'inforCenter': [__dirname + "/src/pages/inforCenter/index.js"],
		'matchCenter': [__dirname + "/src/pages/matchCenter/index.js"],
		'QBi': [__dirname + "/src/pages/QBi/index.js"],
	},
	output: {
		path: __dirname + "/pub",
		filename: './[name]/bundle.js',
	},
	devtool: 'eval-source-map',
	module: {
		rules: [
			{
				test: /\.(vue)$/,
				loader: 'vue-loader',
			},
			{
				test: /\.json$/,
				loader: "json-loader"
			},
			{
				test: /\.js$/,
				exclude: /node_modules/,
				loader: 'babel-loader',
				query: {
					presets: ['es2015', 'stage-0'],
					plugins: ['transform-runtime']
				}
			},
			{
				test: /\.(css|less)$/,
				use: ['style-loader', 'css-loader', 'less-loader', 'postcss-loader']
			},
			{
				test: /\.(eot|woff|woff2|ttf)([\\?]?.*)$/,
				loader: "file-loader"
			},

			{
				test: /\.(png|jpg|gif|svg)$/,
				loader: 'file-loader',
				options: {
					name: '[name].[ext]?[hash]'
				}
			}
		]
	},
	resolve: {
		alias: {
			'vue$': 'vue/dist/vue.esm.js'
		},
		extensions: ['.js', '.vue']
	},
	plugins: [
		new VueLoaderPlugin(),
		new HtmlWebpackPlugin({
			template: './src/pages/inforCenter/index.html',
			filename: 'inforCenter.html',
			inject: 'body',
			chunks: ['inforCenter']
		}),
		new HtmlWebpackPlugin({
			template: './src/pages/matchCenter/index.html',
			filename: 'matchCenter.html',
			inject: 'body',
			chunks: ['matchCenter']
		}),
		new HtmlWebpackPlugin({
			template: './src/pages/QBi/index.html',
			filename: 'QBi.html',
			inject: 'body',
			chunks: ['QBi']
		}),
	],
	devServer: {
		historyApiFallback: true,
		host:'0.0.0.0',
		port: 8888,
		noInfo: true
	},
	performance: {
		hints: false
	},
	devtool: '#eval-source-map'
}


